home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / batchut / bed11.zip / BED.DOC < prev    next >
Text File  |  1985-12-03  |  26KB  |  555 lines

  1.      BED - Batch EDitor VERSION 1.1
  2.  
  3.      A data reformatting utility
  4.  
  5.      (c) 1985 by Ken Goosens
  6.  
  7.      Notice:  this program is distributed free.  You are free to use and
  8.      distribute it provided:
  9.  
  10.           (1) no fee or other consideration is charged.
  11.  
  12.           (2) the program is distributed only in unmodified form.
  13.  
  14.           (3) you accept all responsibility for using this program.  The
  15.           author does not provide any guarantee that this program works
  16.           properly and assumes no liability for use of it.
  17.  
  18.      This program is supported by its author.  Please send any comments or
  19.      enhancements to:
  20.  
  21.                      Ken Goosens
  22.                      5020 Portsmouth Road
  23.                      Fairfax, VA 22032
  24.  
  25.      Or call Ken's bulletin board system at 202-537-7407 to leave a message
  26.      or download the latest version.
  27.  
  28.      A complete set of files consists of
  29.  
  30.      BED.DOC    - this documentation
  31.      BED.EXE    - compiled, executable code
  32.      BED.BAS    - main program
  33.      BEDLIB.BAS - auxiliary BASIC routines used by BED.BAS, separately 
  34.                     compiled
  35.      BED.LIB    - compiled assembler routines used by BED
  36.  
  37.      REPORT.DAT     - a sample report.  We want to stip the report down to
  38.                     pure data, omit commas from numbers, and rearrange
  39.                     dates to year-month-day format with no separator
  40.                     between the date elements.
  41.      REPORT.SPC     - a sample editing specification that works on
  42.                     REPORT.DAT
  43.      REPORT.BAD     - A list of phrases whose presence should exclude a
  44.                     line from the output.  Needed by REPORT.SPC.
  45.  
  46.      Acknowledgement - this program uses some assembler routines
  47.      distributed by Tom Hanlin in ADVBAS.LIB.  ADVBAS is an excellent
  48.      shareware product that includes many useful assembler routines.
  49.  
  50.      7 December 1985
  51.  
  52.  
  53.  
  54.      *   *   *   *   *   *   *   *   *   *   *   *   *   *   *   *   *
  55.  
  56.                            TABLE OF CONTENTS       
  57.  
  58.      What is BED?
  59.  
  60.      What Advantages does BED have over other Editors?
  61.  
  62.      How Can BED be Used?
  63.  
  64.      Exactly What Edits can BED do?
  65.  
  66.      How to Invoke BED
  67.  
  68.      Explanation of Each Editing Specification
  69.  
  70.      The Order of Edits
  71.  
  72.      How to Recompile BED
  73.  
  74.      *   *   *   *   *   *   *   *   *   *   *   *   *   *   *   *   *
  75.  
  76.  
  77.      What is BED?
  78.  
  79.      BED is a batch editor.  EDITOR - because it modifies lines of text in
  80.      a file.  BATCH - because it runs batch rather than interactively.  The
  81.      only thing you specify interactively is what edits you want done.  
  82.  
  83.  
  84.      What Advantages does BED have over other Editors?
  85.  
  86.      o    Runs batch.
  87.  
  88.      BED is designed to run entirely unattended after you set up a
  89.      configuration file telling BED what to do.  This makes it ideal for
  90.      production work where files are edited repeatedly the same way.
  91.  
  92.      o    Speed.
  93.  
  94.      BED runs very fast.  "Interactive" editors often include a macro
  95.      facility whereby they can run batch also.  But, for each edit, they
  96.      usually page in part of the file that can be held in RAM, and do the
  97.      edit.  Each edit makes a full pass through the data file.  BED makes
  98.      exactly one pass through the data file, no matter how many edits are
  99.      done.  BED is also much more efficient at doing global search and
  100.      replaces than most editors.
  101.  
  102.      o    Does complex reformatting simply.
  103.  
  104.      BED is designed to make some complex edits very easy, such as
  105.      reformating date fields (e.g. removing separators and rearranging
  106.      fields, such as MM/DD/YY to YYMMDD) and changing formatted numbers
  107.      (dollar signs, parentheses around negative numbers, commas separating
  108.      thousands) to a "pure" data format (e.g. "($89,655.21)" to "-
  109.      89655.21").  BED also will preserve the original field length when
  110.      doing such edits by inserting filler blanks.  These edits are either
  111.      very difficult or impossible using other editors.
  112.  
  113.      o    No theoretical or practical limit on file size.
  114.  
  115.      Most editors either will not load large files or take forever to load
  116.      them before editing can begin, so that the time it takes to edit files
  117.      grows geometrically with file size.  BED works just as efficiently on
  118.      large files as on small.
  119.  
  120.      o    Maximum line length of 32,676.
  121.  
  122.      Most editors have a maximum line size of 256 characters or less.  BED
  123.      will edit individual lines up to 32,676.
  124.  
  125.      o    Supports criteria for excluding entire lines.
  126.  
  127.      Few editors allow you to select what lines to delete from a file.  BED
  128.      allows entire lines to be omitted based on length or the presence of
  129.      keywords.  Line exclusion criteria are applied before any other edits
  130.      are done.
  131.  
  132.      o    BED is freeform.
  133.  
  134.      This means that the text you edit does not have to be in any special
  135.      location or column.  BED will find the text to be edited no matter
  136.      where it occurs in the file or line.  Data base editors that allow you
  137.      to reformat data always require that the data be broken into fields
  138.      which are either fixed in length and/or order.  BED does not impose a
  139.      structure on the data.  You do not have divide your file into fields
  140.      and records, nor do you tell BED where in the file the data is
  141.      located.
  142.  
  143.      o    Source code is provided.
  144.  
  145.      You can fix bugs in BED or enhance it to do new tasks.  Commercial
  146.      editors never give you the source code.
  147.  
  148.  
  149.      How Can BED be Used?
  150.  
  151.      BED's primary use is to
  152.  
  153.      o    prepare data for reading into other programs.
  154.  
  155.      BED is basically a data preparation utility for "cleaning",
  156.      "scrubbing", or reformatting data.
  157.  
  158.      Often data needs to be changed before it can be loaded into a data
  159.      base management system for analysis and reporting.  A typical problem
  160.      is that data contains characters that make it easier for the human eye
  161.      to read, but which a data base management system can not accept,
  162.      including
  163.  
  164.      o    "non-numeric" characters in numeric fields, such as a dollar
  165.           sign, comma, or parentheses around negative numbers
  166.  
  167.      o    dates with separators between the month, day, and year, and the
  168.           fields in the wrong order.
  169.  
  170.      It is always good data processing policy to never store data with
  171.      formatting in it, but only to add formatting in reports. 
  172.      Unfortunately, this policy is sometimes violated, and sometimes the
  173.      only dump available of data is a report (spreadsheets are among the
  174.      worst offenders).  The presence of "formatting" characters in data
  175.      fields usually means that other programs cannot read the data. 
  176.      Reports also typically include page headers, titles, page numbers,
  177.      blank lines, printer pagination commands (form feeds), as well as
  178.      blank lines, which need to be stripped out to leave pure data.  BED is
  179.      expressly designed to eliminate such formatting.  For example, data
  180.      managers usually store dates in YYMMDD format so that they will sort
  181.      properly, and they will usually batch load dates only in the format. 
  182.      Yet the most common format for dates in the United States is MM-DD-YY. 
  183.      BED allows you to strip off the dashes and rearrange the elements of
  184.      the date.
  185.  
  186.  
  187.      Exactly What Edits can BED do?
  188.  
  189.      o    Exclude entire lines
  190.                -that are shorter than a minimum length
  191.                -that are longer than a maximum length
  192.                -that contain any of a specified list of strings
  193.  
  194.      Typical use:  you must load data that came from a report and which has
  195.      blank lines in it and page headers.  You must strip out these lines to
  196.      leave the pure data.  You tell BED to exclude empty lines (shorter
  197.      than 1) and lines with "PAGE" in it.  Form feeds, used by most
  198.      printers to cause a page eject, are automatically stripped out when
  199.      using the delete short line option.
  200.  
  201.      o    Global search and replace
  202.                -convert lette